package cn.edu.scau.cmi.liyetian.client.spring;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import cn.edu.scau.cmi.liyetian.dao.StudentDao;
import cn.edu.scau.cmi.liyetian.dao.StudentDaoImpl;
import cn.edu.scau.cmi.liyetian.domain.Student;
import cn.edu.scau.cmi.liyetian.domain.Teacher;

public class Spring01Client {
	public static void main(String[] args) {
		ApplicationContext ctx = new ClassPathXmlApplicationContext("ApplicationContext.xml");
		Teacher teacher = (Teacher)ctx.getBean("teacher");
		Student student = (Student)ctx.getBean("student");
		System.out.println(teacher);
		System.out.println(student);
		
//		StudentDao studentDao = (StudentDaoImpl)ctx.getBean("studentDao");
//		System.out.println(studentDao);
	}
}
